package com.csproj.dispatch.util;

/**
 * @作者：wgchao
 * @时间：23:15 2018/9/7 0007
 * @用途：集装箱状态
 **/
public enum ContainerStatus {
    WAITBLOCK("wait_sealing_containers", 1), BLOCK("alread_b", 2), ONGOING("stock_in_transit", 3), UNBLOCK("alread_unb", 4), ARRIVE("already_arrived", 5);
    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private ContainerStatus(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (ContainerStatus c : ContainerStatus.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
